<%@ page language="java" contentType="text/html; charset=EUC-KR"
	pageEncoding="EUC-KR"%>
<%@ page import="com.oreilly.servlet.MultipartRequest"%>
<%@ page import="com.oreilly.servlet.multipart.DefaultFileRenamePolicy"%>
<%@ page import="java.util.*"%>

<%
	String uploadPath = request.getRealPath("upload");;
	out.print("uploadPath="+uploadPath);

    int size=10*1024*1024;
       String name ="";
       String subject ="";
       String filename1 ="";
       String filename2 ="";
       String orifilename1 =""; String orifilename2 ="";
      
       
    try{
    	MultipartRequest multi = new MultipartRequest(request,
    			uploadPath,
    			size,
    			"euc-kr",
    			new DefaultFileRenamePolicy());
    	
    	name = multi.getParameter("name");
    	subject = multi.getParameter("subject");
    	Enumeration files = multi.getFileNames();
    	
    	String file1=(String)files.nextElement();
    	filename1=multi.getFilesystemName(file1);
    	orifilename1=multi.getOriginalFileName(file1);
    	
     	String file2=(String)files.nextElement();
    	filename2=multi.getFilesystemName(file2);
    	orifilename2=multi.getOriginalFileName(file2);
    	
    	out.println("<br>"+"uploader :"+ name);
    	out.println("<br>"+"file1 :"+orifilename1);
    	out.println("<br>"+"file2 :"+orifilename2);
    }catch(Exception e){e.printStackTrace();}
    
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
</head>
<body>

</body>
</html>